<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:ctrl="clr-namespace:JsonVisualizer.Internal"
    >
    <Style x:Key="WatermarkTextBox_Default" TargetType="{x:Type ctrl:WatermarkTextBox}">
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="Foreground" Value="#000"/>
        <Setter Property="BorderBrush" Value="#EEE"/>
        <Setter Property="WatermarkBrush" Value="#444"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="SnapsToDevicePixels" Value="true"/>
        <Setter Property="Background">
            <Setter.Value>
                <LinearGradientBrush EndPoint="0,1">
                    <GradientStop Offset="0" Color="#EEE"/>
                    <GradientStop Offset="0.4" Color="#CCC"/>
                </LinearGradientBrush>                  
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ctrl:WatermarkTextBox}">
                    <Grid>
                        <Border x:Name="Border"
                            Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            Padding="2"
                            >

                            <Grid>
                                <ScrollViewer
                                   Margin="0"
                                   x:Name="PART_ContentHost"
                                    SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                />
                                <TextBlock
                                   Margin="4,0,0,0"
                                   VerticalAlignment="Top"
                                   x:Name="Watermark"
                                   Foreground="{TemplateBinding WatermarkBrush}"
                                   FontStyle="Italic"
                                   Text="{TemplateBinding WatermarkText}"
                                   SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                   />
                            </Grid>
                        </Border>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Opacity" Value="0.67"/>
                        </Trigger>
                        <Trigger Property="IsFocused" Value="true">
                            <Setter TargetName="Border" Property="BorderBrush" Value="DodgerBlue"/>
                            <Setter TargetName="Border" Property="BorderThickness" Value="3"/>
                            <Setter TargetName="Border" Property="Margin" Value="-1.5"/>
                        </Trigger>
                        <Trigger Property="IsWatermarkVisible" Value="False">
                            <Setter Property="Visibility" Value="Collapsed" TargetName="Watermark"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="{x:Type ctrl:WatermarkTextBox}" BasedOn="{StaticResource WatermarkTextBox_Default}" />


</ResourceDictionary>
